<!-- 定时任务记录详情弹窗 -->
<template>
  <a-form
    ref="form3"
    class="ele-form-detail"
    :model="scheduledTaskLogModalApp.scheduledTaskLog"
    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
    <a-descriptions :title="scheduledTaskLogModalApp.title" bordered>
<!--      <a-descriptions-item label="标识">-->
<!--        {{ scheduledTaskLogModalApp.scheduledTaskLog.Eid }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="创建人">-->
<!--        {{ scheduledTaskLogModalApp.scheduledTaskLog.creatorName }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="名称">-->
<!--        {{ scheduledTaskLogModalApp.scheduledTaskLog.name }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="任务名称">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.jobName }}
      </a-descriptions-item>
      <a-descriptions-item label="任务分组">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.jobGroup }}
      </a-descriptions-item>
      <a-descriptions-item label="cron表达式">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.cron }}
      </a-descriptions-item>
      <a-descriptions-item label="接口Bean">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.beanName }}
      </a-descriptions-item>
      <a-descriptions-item label="方法">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.methodName }}
      </a-descriptions-item>
      <a-descriptions-item label="方法参数">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.methodParams }}
      </a-descriptions-item>
      <a-descriptions-item label="执行结果">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.result }}
      </a-descriptions-item>
      <a-descriptions-item label="执行开始时间">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.startTime }}
      </a-descriptions-item>
      <a-descriptions-item label="执行结束时间">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.endTime }}
      </a-descriptions-item>
      <a-descriptions-item label="失败原因">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.failReason }}
      </a-descriptions-item>
      <a-descriptions-item label="状态">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.status }}
      </a-descriptions-item>
<!--      <a-descriptions-item label="创建人ID">-->
<!--        {{ scheduledTaskLogModalApp.scheduledTaskLog.creatorId }}-->
<!--      </a-descriptions-item>-->
<!--      <a-descriptions-item label="备注">-->
<!--        {{ scheduledTaskLogModalApp.scheduledTaskLog.remark }}-->
<!--      </a-descriptions-item>-->
      <a-descriptions-item label="创建时间">
        {{ scheduledTaskLogModalApp.scheduledTaskLog.createDatetime }}
      </a-descriptions-item>
    </a-descriptions>
  </a-form>
</template>

<script>
import {defineComponent, reactive, onMounted, inject} from "vue";
import {useRoute} from "vue-router"
import {ScheduledTaskLogService} from "@/views/system/scheduledTask/scheduledTaskLog/scheduledTaskLogService";

export default defineComponent({
  setup() {
    const route = useRoute();
    let routeId = route.params.id;
    let scheduledTaskLogListApp = inject('scheduledTaskLogListApp', reactive({}));
    const scheduledTaskLogModalApp = reactive({id: null, scheduledTaskLog: {}, display: false});

    onMounted(() => {
      scheduledTaskLogModalApp.scheduledTaskLog = {};
      if (routeId) {
        scheduledTaskLogModalApp.id = routeId;
      } else if (scheduledTaskLogListApp.viewModalShowing) {
        scheduledTaskLogModalApp.id = scheduledTaskLogListApp.currentId;
        scheduledTaskLogModalApp.display = true;
      }
      if (scheduledTaskLogModalApp.id) {
        getInfo(scheduledTaskLogModalApp.id);
      }
    })

    const getInfo = (id) => {
      ScheduledTaskLogService.findScheduledTaskLog(id).then((res) => {
        scheduledTaskLogModalApp.scheduledTaskLog = res.data;
        scheduledTaskLogModalApp.title = "查看 " + scheduledTaskLogModalApp.scheduledTaskLog.name;
      })
    }

    return {
      scheduledTaskLogModalApp,
      routeId,
      getInfo,
    }
  }
})
</script>

<style scoped>
</style>

